home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <ctype.h>
- main()
- {
- int ch, count,
- mark = 0xdb; /* to mark characters */
-
- /* Go over entire ASCII table and display the
- * alphanumeric ones. */
- printf("Alphanumeric ones are marked with a %c\n", mark);
- printf(" "); /* This was added to help the format */
- for(count = 0, ch = 0; ch <=0x7f; ch++)
- {
- printf("%#02x", ch);
- /* Print character- if printable */
- if(isprint(ch))
- {
- printf(" %c ", ch);
- }
- else
- {
- printf(" ");
- }
- /* Perform test and put a mark if test succeeds */
- if(isalnum(ch) != 0)
- {
- printf(" %c", mark);
- }
- else
- {
- printf(" ", ch);
- }
- count++;
- if (count == 8)
- {
- printf(" \n");
- count = 0;
- }
- }
- }